home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / trojans / dcron / defs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-13  |  1.9 KB  |  84 lines

  1.  
  2. /*
  3.  * DEFS.H
  4.  *
  5.  * Copyright 1994 Matthew Dillon (dillon@apollo.west.oic.com)
  6.  * May be distributed under the GNU General Public License
  7.  */
  8.  
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <stdarg.h>
  12. #include <string.h>
  13. #include <errno.h>
  14. #include <time.h>
  15. #include <dirent.h>
  16. #include <fcntl.h>
  17. #include <pwd.h>
  18. #include <unistd.h>
  19. #include <grp.h>
  20. #include <sys/ioctl.h>
  21. #include <sys/wait.h>
  22. #include <sys/stat.h>
  23. #include <sys/resource.h>
  24.  
  25. #define Prototype extern
  26. #define arysize(ary)    (sizeof(ary)/sizeof((ary)[0]))
  27.  
  28. #ifndef CRONTABS
  29. #define CRONTABS    "/var/spool/cron/crontabs"
  30. #endif
  31. #ifndef TMPDIR
  32. #define TMPDIR        "/tmp"
  33. #endif
  34. #ifndef OPEN_MAX
  35. #define OPEN_MAX    256
  36. #endif
  37. #ifndef SENDMAIL
  38. #define SENDMAIL    "/usr/lib/sendmail"
  39. #endif
  40. #ifndef SENDMAIL_ARGS
  41. #define SENDMAIL_ARGS    "-t", "-oem", "-i"
  42. #endif
  43. #ifndef CRONUPDATE
  44. #define CRONUPDATE    "cron.update"
  45. #endif
  46. #ifndef MAXLINES
  47. #define MAXLINES    256        /* max lines in non-root crontabs */
  48. #endif
  49. #ifndef PATH_VI
  50. #define PATH_VI        "/usr/bin/vi"    /* location of vi    */
  51. #endif
  52.  
  53.  
  54. #define VERSION    "V2.2"
  55.  
  56. typedef struct CronFile {
  57.     struct CronFile *cf_Next;
  58.     struct CronLine *cf_LineBase;
  59.     char    *cf_User;    /* username            */
  60.     int        cf_Ready;    /* bool: one or more jobs ready    */
  61.     int        cf_Running;    /* bool: one or more jobs running */
  62.     int        cf_Deleted;    /* marked for deletion, ignore    */
  63. } CronFile;
  64.  
  65. typedef struct CronLine {
  66.     struct CronLine *cl_Next;
  67.     char    *cl_Shell;    /* shell command            */
  68.     int        cl_Pid;        /* running pid, 0, or armed (-1)    */
  69.     int        cl_MailFlag;    /* running pid is for mail        */
  70.     int        cl_MailPos;    /* 'empty file' size            */
  71.     char    cl_Mins[60];    /* 0-59                 */
  72.     char    cl_Hrs[24];    /* 0-23                    */
  73.     char    cl_Days[32];    /* 1-31                    */
  74.     char    cl_Mons[12];    /* 0-11                 */
  75.     char    cl_Dow[7];    /* 0-6, beginning sunday        */
  76. } CronLine;
  77.  
  78. #define RUN_RANOUT    1
  79. #define RUN_RUNNING    2
  80. #define RUN_FAILED    3
  81.  
  82. #include "protos.h"
  83.  
  84.